/**
 * Created by Sun on 2020/4/9.
 */
/**
 * Created by Sun on 2020/4/9.
 */
$(function () {

    $.ajax({
        url:'user/getAll',
        success: function (data) {
            for(var i = 0;i< data.length; i++){
                var text = "<tr>"+
                    "<td>"+data[i].id+"</td>"+
                    "<td>"+data[i].username+"</td>"+
                    "<td>"+data[i].password+"</td>"+
                    "<td>"+data[i].createtime+"</td>"+
                    "<td>"+data[i].status+"</td>"+
                    "<td>"+
                    "<a href=\"user/delById?id="+data[i].id+"\" class='btn btn-danger'>删除</a>"+
                    "<a href=\"update.html?id="+data[i].id+"\" class='btn btn-success'>修改</a>"+
                    "</td>"+
                    "</tr>"
                var obj = $(".pool");
                obj.append(text);
            }
        }
    });
});

$(function () {

    $.ajax({
        url:'Monitor/getAll',
        success: function (data) {
            for(var i = 0;i< data.length; i++){
                console.log(data[i]);
                var text = "<tr>"+
                    "<td>"+data[i].ftimestamp+"</td>"+
                    "<td>"+data[i].flogger+"</td>"+
                    "<td>"+data[i].fthread+"</td>"+
                    "<td>"+data[i].flevel+"</td>"+
                    "<td>"+data[i].fmessage+"</td>"+
                    "</tr>"
                var obj = $(".monitorpool");
                obj.append(text);
            }
        }
    });
});



$(function () {

    $.ajax({
        url:'Monitor/getSpaceAll',
        success: function (data) {
            for(var i = 0;i< data.length; i++){
                console.log(data[i]);
                var text = "<tr>"+
                    "<td>"+data[i].tableName+"</td>"+
                    "<td>"+data[i].totalSpace+"</td>"+
                    "<td>"+data[i].freeSpace+"</td>"+
                    "<td>"+data[i].used+"</td>"+
                    "<td>"+data[i].usageRate+"</td>"+
                    "</tr>"
                var obj = $(".monitorspacepool");
                obj.append(text);
            }
        }
    });
});

$(function () {

    $.ajax({
        url:'Monitor/getIndexAll',
        success: function (data) {
            for(var i = 0;i< data.length; i++){
                console.log(data[i]);
                var text = "<tr>"+
                    "<td>"+data[i].OWNER+"</td>"+
                    "<td>"+data[i].INDEX_NAME+"</td>"+
                    "<td>"+data[i].TABLE_OWNER+"</td>"+
                    "<td>"+data[i].TABLE_NAME+"</td>"+
                    "</tr>"
                var obj = $(".monitorindexpool");
                obj.append(text);
            }
        }
    });
});
$(function () {

    $.ajax({
        url:'Monitor/getLockAll',
        success: function (data) {
            for(var i = 0;i< data.length; i++){
                console.log(data[i]);
                var text = "<tr>"+
                    "<td>"+data[i].fid+"</td>"+
                    "<td>"+data[i].fuserName+"</td>"+
                    "<td>"+data[i].ftableName+"</td>"+
                    "<td>"+data[i].fmoudle+"</td>"+
                    "<td>"+data[i].fsql+"</td>"+
                    "</tr>"
                var obj = $(".monitorlockpool");
                obj.append(text);
            }
        }
    });
});


